import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * 数据库连接
 */
public class Demo01 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        //1.搭桥 (加载驱动)
        Class.forName("com.mysql.cj.jdbc.Driver");
        //2. 开门(获取连接Connection接口对象)
        Connection conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/st0104?useSSL=false&serverTimezone=UTC", "root", "123456");

        System.out.println(conn);

    }
}
